//
//  KAlteView.m
//  充电桩
//
//  Created by 王开政 on 2018/8/16.
//  Copyright © 2018年 李超杰. All rights reserved.
//

#import "KAlteView.h"

@implementation KAlteView
-(id)initFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    self.backgroundColor = [UIColor whiteColor];
    
    self.layer.masksToBounds = YES;
    self.layer.cornerRadius = 6;
    
    [self addSubview:self.titleLabel];
    [self addSubview:self.sureButton];
    [self addSubview:self.contentLabel];
    [self addSubview:self.cancelButton];
    [self addSubview:self.line];

    
 
    return  self;
    
}
-(UILabel *)titleLabel{
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(28*kfit, 10*kfit, self.frame.size.width -28*2*kfit, 30*kfit)];
        _titleLabel.font = [UIFont systemFontOfSize:18*kfit];
        _titleLabel.textColor = [UIColor colorWithHexString:@"#101010 "];
        _titleLabel.textAlignment = NSTextAlignmentCenter;
        _titleLabel.numberOfLines = 0;
    }
    return _titleLabel;
}
-(UILabel *)contentLabel{
    if (!_contentLabel) {
        _contentLabel = [[UILabel alloc]initWithFrame:CGRectMake(28*kfit, 40*kfit, self.frame.size.width -28*2*kfit, 40*kfit)];
        _contentLabel.font = [UIFont systemFontOfSize:14*kfit];
        _contentLabel.textColor = [UIColor colorWithHexString:@"#888888 "];
        _contentLabel.textAlignment = NSTextAlignmentCenter;
        _contentLabel.numberOfLines = 0;
    }
    return _contentLabel;
}
-(UIView *)line{
    if (!_line) {
        _line = [[UIView alloc]initWithFrame:CGRectMake(0, 90*kfit, self.frame.size.width, 1)];
        _line.backgroundColor = [UIColor colorWithHexString:@"#E5E5E5"];
    }
    return _line;
}
-(UIButton *)sureButton{
    if (!_sureButton) {
        _sureButton = [[UIButton alloc]initWithFrame:CGRectMake(self.frame.size.width/2, 95*kfit, self.frame.size.width/2, 45)];
        [_sureButton setTitle:@"确定" forState:0];
        [_sureButton setTitleColor:[UIColor colorWithHexString:@"#222222"] forState:0];
    }
    return _sureButton;
}

-(UIButton *)cancelButton{
    if (!_cancelButton) {
        _cancelButton = [[UIButton alloc]initWithFrame:CGRectMake(0, 95*kfit, self.frame.size.width/2, 45)];
        [_cancelButton setTitle:@"取消" forState:0];
        [_cancelButton setTitleColor:[UIColor colorWithHexString:@"#222222"] forState:0];
    }
    return _cancelButton;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
